package com.example.administrator.damaiwang.Utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

import com.example.administrator.damaiwang.Activity.App;

/**
 * Created by Administrator on 2016/12/13.
 */
public class NetUtils {
        public static boolean isConnect(){
            ConnectivityManager mgr= (ConnectivityManager)
                    App.context.getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo netInfo = mgr.getActiveNetworkInfo();
            if(netInfo!=null){
                return netInfo.isConnected();
            }

            return false;
        }
}
